<template>
	<view class="person-container">
		<navBar></navBar>
		<view class="person-info">
			<view class="info-main">
				<view class="main-item"
				 v-for="(item, index) in form.formLabel"
				 :key="index">
					<view class="item-label">{{ item.label }}</view>
					<view class="item-type">
						<uni-easyinput v-model="form.formData[item.prop]" type="textarea" maxlength="1000" :clearable="false" :placeholder=" '请输入' + item.label"></uni-easyinput>
						<!-- <image src="@/static/img/common/arrr.png" mode=""></image> -->
					</view>
				</view>
			</view>
		</view>
		<view class="btn">
			<button class="btns" @click="save">保存</button>
		</view>
	</view>
</template>

<script setup>
import { ref, reactive } from 'vue'	
import { onLoad } from '@dcloudio/uni-app'
import navBar from '@/components/navBar.vue';
// const title = ref('工作经历')
import api from '@/utils/api/recruit.js'
import { showToast } from '@/utils/toast.js'
onLoad(res=> {
	if(res.strs){
		form.formData.introduction = res.strs
	}
})
const form = reactive({
	formLabel: [
		{ label: '技能特长', prop: 'introduction' },
	],
	formData: {}
})
// 保存
const save = async _ => {
	if(!form.formData.introduction){
		return showToast('请输入技能特长')
	}
	let data = {
		saveType: 'SKILLS_STRENGTHS',
		appUserResume: form.formData
	}
	const res = await api.saveUserResume(data)
	console.log(res, '=====');
	if(res.code === 200) {
		showToast(res.msg)
		uni.$emit('refsh')
		uni.navigateBack()
	}
}
</script>

<style lang="scss" scoped>
::v-deep .is-input-border{
	border: none !important;
}	
::v-deep .uni-easyinput__content-textarea{
	min-height: 200rpx !important;
	height: 300rpx !important;
}
::v-deep .uni-easyinput__content-input{
	padding-left: 0 !important;
}
::v-deep .uni-date-x--border{
	border: none !important;
}
::v-deep .uni-icons{
	display: none !important;
}
.person-container{
	height: 100vh;
	background: #fff;
	.person-info{
		padding: 32rpx;
		box-sizing: border-box;
		margin-top: 30rpx;
		.info-main{
			width: 100%;
			.main-item{
				display: flex;
				// align-items: center;
				flex-direction: column;
				// justify-content: space-between;
					.item-label{
						font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
						font-weight: normal;
						font-size: 32rpx;
						color: #262626;
						line-height: 48rpx;
						text-align: left;
						font-style: normal;
						text-transform: none;
						// margin: 16rpx 0;

				}

				.item-type{
					display: flex;
					align-items: center;
					// height: 70rpx;
					// padding: 32rpx 0;
					box-sizing: border-box;
					// border-bottom: 1rpx solid #E5E5E5;
					.type-time{
						flex: 1;
						// height: 40rpx;
					}
					image{
						width: 38rpx;
						height: 38rpx;
					}
				}
			}
		}
	}
	.btn{
		position: fixed;
		bottom: 0;
		left: 0;
		height: 180rpx;
		padding: 24rpx;
		box-sizing: border-box;
		background: #fff;
		width: 100%;
		display: flex;
		.btns{
			width: 640rpx;
			height: 88rpx;
			background: #6B64D3;
			border-radius: 44rpx 44rpx 44rpx 44rpx;
			color: #fff;
		}
	}
}
</style>
